#pragma once

#include <iostream>
#include <string>
#include <pthread.h>
#include "LockGuard.hpp"

int __CNT__ = 10;
pthread_mutex_t _Task_mutex = PTHREAD_MUTEX_INITIALIZER;

class Task
{
public:
    Task() = default;
    Task(int a, int b) : _a(a), _b(b)
    {
    }
    void debug()
    {
        printf("%d + %d = ?\n", _a, _b);
    }
    void operator()()
    {
        LockGuard lock(&_Task_mutex);
        // printf("%d + %d = %d\n", _a, _b, _a + _b);
        __CNT__--;
    }
private:
    int _a, _b;
};